<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
  <title>登录</title>
  <script type="text/javascript" src="js/jquery-3.2.1.min.js" ></script>
</head>
<body>
			<!-- 	<form th:action="@{/login}" method="post">
                        <div class="form-group" style="margin-top: 30px">
                            <div class="input-group col-md-6 col-md-offset-3">
                                <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
                                <input type="text" class="form-control" name="username" id="username" placeholder="账号" value="Q1">
                            </div>
                        </div>
                        <div class="form-group ">
                            <div class="input-group col-md-6 col-md-offset-3">
                                <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
                                <input type="password" class="form-control" name="password" id="password" value="7754"
                                       placeholder="密码">
                            </div>
                        </div>
                        <br>
                        <div th:if="${param.error}">
                            <p style="text-align: center" class="text-danger">登录失败，账号或密码错误!</p>
                        </div>
                        <div th:if="${result}">
                            <p style="text-align: center" class="text-success" th:text="${result}"></p>
                        </div>
                        <div class="form-group">
                            <div class="input-group col-md-6 col-md-offset-3 col-xs-12 ">
                                <button type="submit" class="btn btn-primary btn-block">登录</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-group col-md-6 col-md-offset-3" style="text-align: center">
                                <a href="/register">创建账号</a> | 忘记密码?
                            </div>
                        </div>
                    </form>
                     -->
         <form id="loginForm">
        	<input type="text" class="form-control" name="username" id="username" placeholder="账号" value="Q1">
         	<input type="password" class="form-control" name="password" id="password" value="7754" placeholder="密码">
         	<input type="checkbox" value="true" name="remember-me">记住我
         </form>
		 <input type="submit" value="登录" onclick="clickBt()">
         
         
         <script>
         
         
         function clickBt(){
           var jsondata = $("#loginForm").serialize()
           $.ajax({
        	   type: "POST",
        	   url: "/login",
        	   dataType: "json",
        	   data: jsondata,
        	   success: function(re){
        		   console.log(re);
        	   },
        	   error: function(re){
        		   console.log(re);
        	   }
           })
	     }
         </script>
</body>
</html>